#!/usr/bin/env python
# -*- coding:utf-8 -*-

# file:04操作sqlite3查询.py
# author: 马国鑫
# datetime:2022/4/17 21:31
# software: PyCharm

"""
this is function  description 
"""

import sqlite3

conn = sqlite3.connect(r'D:\Python_code\python_web_study\db\demo.db')
cur = conn.cursor()

sql = 'select * from t_person'

try:
    cur.execute(sql)
    # 获取结果集
    person_all = cur.fetchall()
    # print(person_all)
    for person in person_all:
        print(person)
except Exception as e:
    print(e)
    print('查询所有数据失败')
finally:
    cur.close()
    conn.close()


